#!/bin/bash

if [ ! -f make_ubuntu.sh ]; then
echo 'make_ubuntu.sh must be run within its container folder' 1>&2
exit 1
fi

CURDIR=`pwd`
OLDGOPATH="$GOPATH"
OLDGOBIN="$GOBIN"
export GOPATH="$CURDIR"
export GOBIN="$CURDIR/bin"

#gofmt -tabs=false -tabwidth=4 -w src

go install app

export GOPATH="$OLDGOPATH"
export GOPATH="$OLDGOBIN"


#kill `ps axw|grep bbs|grep -v grep|awk '{print $1}'`

mv bin/app www/gobbs

echo 'build finished'

echo 'start bbs...'

cd www

./gobbs
